Dynamic programming
Constrained Subsequence Sum
decreasing queue dynamic programming
Comments CountDescription
Stone Game VII
Comments CountDescription
Jump Game VI
heap algorithm dynamic programming
Comments CountDescription
You are given a 0-indexed integer array nums and an integer k.
Minimum Cost Tree From Leaf Values
Comments CountProblem description
Given an array arr of positive integers, consider all binary trees such that: Each node has either 0 or 2 children; The values of arr correspond to the values of each leaf in an in-order traversal of the tree. (Recall that a node is a leaf if and only if it has 0 children.) The value of each non-leaf node is equal to the product of the largest leaf value in its left and right subtree respectively. Among all possible binary trees considered, return the smallest possible sum of the values of each non-leaf node. It is guaranteed this sum fits into a 32-bit integer.
Smallest Sufficient Team
algorithm NP Hard dynamic programming
Comments CountProblem description
In a project, you have a list of required skills req_skills, and a list of people. The i-th person people[i] contains a list of skills that person has.
Shortest Common Supersequence
leetcode algorithm dynamic programming
Comments CountProblem description
Given two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences. If multiple answers exist, you may return any of them.
Partition Array for Maximum Sum (LC1043)
dynamic programming leetcode algorithm
Comments CountProblem description
Given an integer array A, you partition the array into (contiguous) subarrays of length at most K. After partitioning, each subarray has their values changed to become the maximum value of that subarray.
House Robber III (LC337)
leetcode algorithm binary tree dynamic programming
Comments CountProblem description
The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the “root.” Besides the root, each house has one and only one parent house. After a tour, the smart thief realized that “all houses in this place forms a binary tree”. It will automatically contact the police if two directly-linked houses were broken into on the same night.
Minimum Score Triangulation of Polygon (LC1039)
leetcode algorithm dynamic programming
Comments CountProblem description
Given N, consider a convex N-sided polygon with vertices labelled A[0], A[i], …, A[N-1] in clockwise order.